<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\modules\Order\models\LeaderSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '领队列表';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="leader-index">

     <h2 class="page-header">
        <small><?= Html::encode($this->title) ?></small>
        <p class="pull-right">
            <?= Html::a('创建新领队', ['create-new'], ['class' => 'btn btn-success']) ?>
        </p>   
    </h2>     
    <p>
         <?php echo $this->render('_search', ['model' => $searchModel]); ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        //'filterModel' => $searchModel,
        'layout'  =>  "{items}\n{pager}",
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            //'id',
            'first_name',
            'last_name',
            'en_first_name',
            'en_last_name',
            // 'code',
            // 'pinyin',
            // 'gender',
            // 'birthday',
            // 'country',
            // 'passport',
            // 'passport_add',
            // 'passport_date',
            // 'passport_type',
            // 'phone',
            // 'remark',
            [
                'attribute' => 'status',
                'filter' =>  Yii::$app->params['status'],
                'value' => function ($model) {
                        return Yii::$app->params['status'][$model->status];
                    },
            ],
            // 'user_id',
            // 'created_at',
            // 'updated_at',

            [
                'class' => 'yii\grid\ActionColumn',
                'template' =>"{view} {update}"
            ],
        ],
    ]); ?>
</div>
